

<?php



@ $caseid = strip_tags($_POST['caseid']);
@ $firstname = strip_tags($_POST['firstname']);
@ $lastname = strip_tags($_POST['lastname']);
@ $age = strip_tags($_POST['age']);
@ $gender = strip_tags($_POST['gender']);
@ $weight = strip_tags($_POST['weight']);
@ $prevdisease = strip_tags($_POST['prevdisease']);
@ $sweating = strip_tags($_POST['sweating']);
@ $bp = strip_tags($_POST['bp']);
@ $cough = strip_tags($_POST['cough']);
@ $addiction = strip_tags($_POST['addiction']);
@ $allergy = strip_tags($_POST['allergy']);
@ $pain = strip_tags($_POST['pain']);
@ $comments = strip_tags($_POST['comments']);
@ $date = date("Y-m-d");

if ($caseid ) {
	
	if ($firstname && $lastname && $caseid)

		//check for existance

		//open database
		{
		$connect = mysql_connect("localhost", "root", "bytewalla5");
		mysql_select_db("ssa"); //select database
		
		$queryreg = mysql_query("INSERT INTO patient VALUES ('','$caseid','$firstname','$lastname',
		'$age','$gender','$weight','$prevdisease','$sweating','$bp','$cough','$addiction','$allergy','$pain','$comments','$date')");

	} else {
		echo 'please enter';
	}
}
?>

<?php
include 'header.php';
?>

<!-- content -->
			<article id="content">
			
 
<?php


session_start();

if (isset ($_SESSION['username'])) {

	echo "Welcome, " . $_SESSION['username'] . "!  <br><a href='logout.php'>Log out</a>";
} else
	die("you must be logged in! <br> <a href='ssa.html'><strong>Return</strong></a>");
?>
				<div class="wrapper tabs">
     <section class="col1">
						<h2 class="under">Register Patient Information</h2>
						<form id="ContactForm" action='insert.php' method="post">
						<div>
						<div  class="wrapper">
						<h3>Patient Information</h3>
								<span>Case ID:</span>
								<input type="text" name='caseid' class="input" >
							</div>


							<div  class="wrapper">
								<span>First Name:</span>
								<input type="text" name='firstname' class="input" >
							</div>
							<div  class="wrapper">
								<span>Last Name:</span>
								<input type="text" name='lastname' class="input" >
							</div>
							<div  class="wrapper">
								<span>Age:</span>
								<input type="text" name='age' class="input" >
							</div>
							<div  class="wrapper">
								<span>Gender:</span>
								<input type="text" name='gender' class="input" >
							</div>
							<div  class="wrapper">
								<span>Weight:</span>
								<input type="text" name='weight' class="input" >
							</div>
                                                         <h3>Symptoms</h3>
                                                        <div  class="wrapper">
								<span>Previous disease:</span>
								<input type="text" name='prevdisease' class="input" >
							</div>
                                                        <div  class="wrapper">
								<span>Sweating:</span>
								<input type="text" name='sweating' class="input" >
							</div>
                                                        <div  class="wrapper">
								<span>Blood pressure:</span>
								<input type="text" name='bp' class="input" >
							</div>
                                                        <div  class="wrapper">
								<span>Cough:</span>
								<input type="text" name='cough' class="input" >
							</div>
                                                        <div  class="wrapper">
								<span>Addiction:</span>
								<input type="text" name='addiction' class="input" >
							</div>
                                                        <div  class="wrapper">
								<span>Allergy:</span>
								<input type="text" name='allergy' class="input" >
							</div>
                                                        <div  class="wrapper">
								<span>Pain:</span>
								<input type="text" name='pain' class="input" >
							</div>
                                                        <div  class="textarea_box">
								<span>Commments:</span>
								<textarea name="comments" cols="1" rows="1" ></textarea>

							</div>
                                                          
						  <a href="#" onClick="document.getElementById('ContactForm').submit()">Send</a> 
							<a href="#" onClick="document.getElementById('ContactForm').reset()">Clear</a>
						</div>
					</form>
					</section>


				</div>

			</article>
		</div>
	</div>


  <?php


include 'footer.php';
?>



